package com.jjb.spider.mqtt.model;

import io.netty.handler.codec.mqtt.MqttQoS;

import java.util.Objects;

public class TopSubscribeMessage {

    private String topic ;
    private Integer qos ;

    public TopSubscribeMessage() {
    }

    public TopSubscribeMessage(String topic) {
        this.topic = topic;
    }

    public TopSubscribeMessage(String topic, Integer qos) {
        this.topic = topic;
        this.qos = qos;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public Integer getQos() {
        return qos;
    }

    public void setQos(Integer qos) {
        this.qos = qos;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TopSubscribeMessage that = (TopSubscribeMessage) o;
        return Objects.equals(topic, that.topic);
    }

    @Override
    public int hashCode() {
        return Objects.hash(topic);
    }
}
